package com.cm.study.other.design.patterns.responsibility;

import java.util.ArrayList;
import java.util.List;

public class ResponsibilityChainPattern {

    public static void main(String[] args) {
        List<Chain> allChain = getAllChain();
        Chains chains = new Chains(allChain);
        chains.doChain();
    }
    public static List<Chain> getAllChain(){
        List<Chain> chains = new ArrayList<Chain>();
        Chain chain1 = new Chain1();
        Chain chain2 = new Chain2();
        Chain chain3 = new Chain3();
        chains.add(chain1);
        chains.add(chain2);
        chains.add(chain3);
        return chains;
    }
}
